from flask import Flask

app = None


def get_app():
    global app
    if app is None:
        app = Flask(__name__)

        app.json.ensure_ascii = False

        from api.apps.routes.user import user_controller
        app.register_blueprint(user_controller, url_prefix='/api')

        from api.apps.errors import handler
        handler.error_handler(app)

    return app
